<?php
namespace app\api\controller\v1;

use app\api\service\UserService;
use app\model\Sign;

class Index
{


    /**
     *首页接口
     * */
    public function index()
    {
        $wx = config('wx.app_id');

        $today = date('Y-m-d');
        $yesterday = date('Y-m-d',strtotime('-1 day'));
        $todayJoinCount = UserService::countJoinInfo($today);
        $yesterdaySignInfo = UserService::countSignInfo($yesterday);
        return json([
            'code'=>1,
            'data'=>[
                'join_count'=> $todayJoinCount,
                'join_list'=> [],
                'status' => 2, //1 支付 2 签到
                'sign_success_count'=>$yesterdaySignInfo[Sign::SIGNED_YES],
                'sign_fail_count' => $yesterdaySignInfo[Sign::SIGNED_NO],
                'sign_list' =>[]
            ]
        ]);
    }

}
